<template>
	<view class="mini-card">
		<view class="card-item" v-for="(item,i) in miniCartList" :key="i" @tap="$Router.push({path: '/pages/goods/goods_detail', query: {from: 'group'}})">
			<view class="img">
				<image class="left-img" :src="item.image + ''" mode=""></image>
			</view>
			<view class="right-content">
				<view class="title">{{item.title}}</view>
				<view class="num">还差{{item.num}}人拼团成功</view>
				<view class="price-btn">
					<view class="price">
						<view class="icon">￥</view>
						<view class="money">{{item.money}}</view>
					</view>
					<view class="btn">
						<image class="img_" src="../../static/img/btn-bj.png" mode=""></image>
						<view class="text_1">立即拼团</view>
					</view>
				</view>
			</view>
			<view class="tag">
				{{item.now}}人拼
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "t-group-cart",
		props: {
			// miniCartList: {}
		},
		data() {
			return {
				miniCartList: [{
						title: '2022夏季女装甜美方领蝴蝶结2022夏季女装甜美方领蝴蝶结',
						num: 10,
						money: 188,
						image: "../../static/img/group_1.png",
						now: 2
					},
					{
						title: '2022夏季女装甜美方领蝴蝶结2022夏季女装甜美方领蝴蝶结',
						num: 5,
						money: 188,
						image: '../../static/img/group_2.png',
						now: 2
					}
				]
			};
		}
	}
</script>

<style lang="scss">
	.mini-card {
		margin: 20rpx 18rpx 20rpx 18rpx;

		.card-item {
			background-color: #fff;
			position: relative;
			display: flex;
			border-radius: 10rpx;
			overflow: hidden;
			margin-bottom: 20rpx;
			// &:last-child {
			// 	margin-bottom: 0;
			// }
			.img {
				width: 200rpx;
				height: 200rpx;
				margin-right: 28rpx;
				background-color: #ccc;

				.left-img {
					width: 100%;
					height: 100%;
				}
			}

			.right-content {
				height: 100%;
				width: 65%;

				.title {
					width: 368rpx;
					font-size: 24rpx;
					font-weight: bold;
					letter-spacing: 1rpx;
					color: #333333;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					margin-top: 29rpx;
				}

				.num {
					font-size: 20rpx;
					letter-spacing: 2rpx;
					color: #989898;
					margin: 30rpx 0 10rpx 0;
				}

				.price-btn {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.price {
						display: flex;
						align-items: center;

						.icon {
							font-weight: bold;
							font-size: 24rpx;
							letter-spacing: 2rpx;
							color: #ff0000;
						}

						.money {
							font-size: 30rpx;
							font-weight: bold;
							letter-spacing: 1rpx;
							color: #ff0000;
						}
					}

					.btn {
						position: relative;
						display: flex;
						align-items: center;
						padding-left: 15rpx;
						width: 160rpx;
						height: 51rpx;

						.img_ {
							width: 100%;
							height: 100%;
						}

						.text_1 {
							position: absolute;
							left: 30rpx;
							top: 50%;
							transform: translateY(-50%);
							font-size: 22rpx;
							color: #ffffff;
						}
					}
				}
			}

			.tag {
				position: absolute;
				right: 0;
				top: 0;
				display: flex;
				justify-content: center;
				align-items: center;
				width: 70rpx;
				height: 38rpx;
				background-image: linear-gradient(-40deg,
						#ff4e19 0%,
						#ff2400 90%),
					linear-gradient(#fbd9d3,
						#fbd9d3);
				background-blend-mode: normal,
					normal;
				border-radius: 0rpx 10rpx 0rpx 10rpx;
				font-family: MicrosoftYaHeiLight;
				font-size: 18rpx;
				color: #ffffff;
			}
		}
	}
</style>
